Skip to content

fix Issue 11048 - Default arguments bypass most attributes check (pure, @safe, @nogc)#14309

Closed
ibuclaw wants to merge 4 commits intodlang:masterfrom
ibuclaw:issue11048
Closed

fix Issue 11048 - Default arguments bypass most attributes check (pure, @safe, @nogc)#14309
ibuclaw wants to merge 4 commits intodlang:masterfrom
ibuclaw:issue11048

Conversation

@ibuclaw
Copy link
Copy Markdown
Member

@ibuclaw ibuclaw commented Jul 16, 2022

Variant on #14214 - this use of inlineCopy is exposing a hole in the @safe system.

Checking the testsuite first, then might fold the two together.

@dlang-bot
Copy link
Copy Markdown
Contributor

dlang-bot commented Jul 16, 2022

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
2437 normal ICE(tocsym.c, !needThis()) - default struct argument
2935 normal ICE(out.c) using struct with constructor as function default argument
11048 major Default arguments bypass most attributes check (pure, @safe, @nogc)
13442 minor __gshared default value allowed in @safe function signature

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14309"

@ibuclaw ibuclaw force-pushed the issue11048 branch 2 times, most recently from 2d8b2eb to a441b3b Compare July 16, 2022 09:48
@thewilsonator
Copy link
Copy Markdown
Contributor

This should definitely target stable

@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Jul 16, 2022

This should definitely target stable

This should definitely not.

@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Jul 16, 2022

Hmm, test in issue 19645 because defaultArgSemantic eagerly folds away the cast expression.

This'll need a bit more plumbing to get right.

@dkorpel
Copy link
Copy Markdown
Contributor

dkorpel commented Oct 17, 2022

Are you still working on this @ibuclaw ?

@Bolpat
Copy link
Copy Markdown
Contributor

Bolpat commented Jun 27, 2024

If possible, let the error message state that the problem is due to default values. Having the error message point to something that isn’t there is very confusing.

@dkorpel
Copy link
Copy Markdown
Contributor

dkorpel commented Apr 14, 2026

Superseded by #22903 and #22908

@dkorpel dkorpel closed this Apr 14, 2026
@ibuclaw ibuclaw deleted the issue11048 branch April 15, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants